/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.bookcomment
 * IBookCommentService.java
 * 创建人:Marlon 
 * 时间：2016年08月28日 19:07:05
 * 2015潭州教育公司-版权所有
 */
package com.tz.service.bookcomment.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tz.bean.BookComment;
import com.tz.bean.TzParams;
import com.tz.dao.bookcomment.IBookCommentMapper;
import com.tz.service.bookcomment.IBookCommentService;
import com.tz.util.TmStringUtils;

/**
 * 评论留言serviceImpl
 * IBookCommentService
 * 创建人:Marlon 
 * 时间：2016年08月28日 19:07:05
 * @version 1.0.0
 * 
 */
@Service
public class BookCommentServiceImpl implements IBookCommentService{

	@Autowired
	private IBookCommentMapper bookcommentMapper;
	
	@Override
	public List<BookComment> findBookComments(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("create_time desc");
		return bookcommentMapper.findBookComments(params);
	}
	
	@Override
	public int count(TzParams params){
		return bookcommentMapper.count(params);
	}

	@Override
	public BookComment get(Integer id) {
		return bookcommentMapper.get(id);
	}

	@Override
	public int save(BookComment bookcomment) {
		return bookcommentMapper.save(bookcomment);
	}

	@Override
	public int update(BookComment bookcomment) {
		return bookcommentMapper.update(bookcomment);
	}

	@Override
	public int delete(TzParams params) {
		return bookcommentMapper.delete(params);
	}
}
